package website.seamonster.ethegg.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import website.seamonster.ethegg.dataobject.User;

import javax.transaction.Transactional;

/**
 * Created by 罗海量
 * 2018-07-17 19:05
 */
public interface UserRepository extends JpaRepository<User, String> {
    public User findFirstByPrCode(String prCode);

    public User findFirstByUserName(String userName);

    @Modifying
    @Transactional
    @Query("delete from User u where u.id = ?1")
    int deleteById(String id);
}
